d2jsp is (c) 2002-2005 by Paul Taulborg (njaguar)

** d2jsp is *not* free software! Keys to unlock d2jsp will be provided for $25 each. **

Please refer to LICENSE.txt for licensing details.

HISTORY of d2jsp.dll core
Last updated 12/24/2005 09:15 CST by njaguar

Version History:

version 1.1.0 -
	.	Fixed a bug in the GAME_MSG event. Was corrupting the string returned to the scripts.

	.	Rewrote event handler system, should now be much more stable.
		Under high load conditions, spidermonkey could get in a funky state previously.

	.	EVENT_NPCMOVE works again.


version 1.0.11 -
	.	Fixed crash bug in player.interact(1);	// player trade accept OK prompt

version 1.0.10 -
	.	Fixed crash bug in acceptTrade();	// to accept a trade

version 1.0.9 -
	.	Fixed crash bug in getRating();

version 1.0.8 -
	.	Fixed a bug where if you closed D2 while d2jsp was attached, it would crash

version 1.0.7 -
	.	Fixed random cursor movements when D2 doesn't have focus (using blockMinimize())

version 1.0.6 -
	.	Fixed random cursor movements when D2 is minimized.

version 1.0.5 -
	.	Fixed a crash bug in clickItem() if you passed an invalid item as a parameter.

version 1.0.4 -
	.	Fixed transmute(); // thanks for bug report AzGul^
		Was crashing when used. Fixed function definition.

version 1.0.3 -
	.	Fixed a display bug caused by taking a waypoint across acts while D2 is minimized.
		Would cause the color pallette to become corrupt.

version 1.0.2 -
	.	Fixed a bug in getArea(); Function definition was incorrect.

version 1.0.1 -
	.	Fixed item.shop(3); Was not functioning correctly. This is the shift buy command.

version 1.0.0 - ()
	.	Added getParty( [String playerName] );	// added optional overload to getParty to accept a players name directly.
		Note: Useful for say, a follow bot where you know the leaders name.
		http://www.d2jsp.org/commandref/index.php#getParty

	.	Removed debug output for item.usable; (oops, thanks for reporting Shrek_III)

	.	Added dc6 image support to screenhooks! Simply specify the mpq path, instead of a file path!
		Example: sh.image = "DATA\\GLOBAL\\ui\\panel\\invchar6tab.dc6";	// loads the out of arrows image
		http://www.d2jsp.org/commandref/index.php#

	.	Added count = unit.getItemsCount();	// returns the number of items the unit possesses.
		Note: This is useful for shopping, to check when the number of NPC items stabalizes,
			you know the loading of items is complete.
		Note: This method is much faster than using unit.getItems().length;
		http://www.d2jsp.org/commandref/index.php#

	.	Added bool = childUnit.isParent( [Unit parentUnit] );	// checks to see if parentUnit is a parent of childUnit, returns true/false
		Note: if parentUnit is not passed (or is invalid), will assume 'me' object for the parent check.
		http://www.d2jsp.org/commandref/index.php#

	.	Added Unit = unit.getItem( int bodyLoc );	// gets a unit item at the bodyloc of the target unit
		Example: me.getItem(8);	// get my belt
		Example: getUnit(102).getItem(1); // get mercenary's helmet
		Note: Also works on other players, and summons! (Iron Golem, Valk, etc!)
		See sdk/bodylocations.txt for a list of each location.
		http://www.d2jsp.org/commandref/index.php#

	.	Added percent = getMercHP( [1] );	// returns the current HP of your mercenary! (Without the odd D2 flakiness)
		Note: Default will return the percent (0 to 100) of life of your mercenary.
		Note: Pass 1 as the parameter to return the actual life value, instead of the percent.
		Note: This value is only updated about once a second, but it's 100% stable, since it doesn't get the fluctuating 'actual hp'
		http://www.d2jsp.org/commandref/index.php#

	.	Added setClipboard( String text );	// sets the clipboard text with the text passed.
		http://www.d2jsp.org/commandref/index.php#

	.	Added text = getClipboard();	// returns the currently set text in the clipboard.
		http://www.d2jsp.org/commandref/index.php#

	.	Removed experience hover (perm show experience) option. (me.showexp)

	.	Removed me.miscscreenmode, use getCursorType()

	.	Updated d2jsp for Diablo II v1.11

	.	Updated d2jsp for Diablo II v1.11b

	.	d2jsp is now version 1.0.0!

	.	EVENT_NEWITEM now only spawns when items are newly created for the game client.
		* No longer spawns during an item mode change!

	.	EVENT_PARTYMSG now displays hostile messages as well as party request invites.

	.	EVENT_HOSTILEMSG removed. Look for EVENT_PARTYMSG with color code 8 or 0 for hostile messages.




version 0.50 - ()
	.	Added item.usable;	// returns 0 if you can use/equip this item, non-zero if you can't.
		Notes: The return value is a bitmask of the following:
		0 = Usable, 1 = Not Usable, 2 = Strength Too Low, 4 = Dexterity Too Low, 8 = Level Too Low
		Example: Item has too high str/dex reqs, so the return value will be: 1+2+4 = 7
		Example: Item has too high level req: return value is 9 (1+8)
		Example: Item has too high dex req, return value is 5 (1+4)
		http://www.d2jsp.org/commandref/index.php#unit.usable

	.	Added xy = item.getFreeSpace( int location );	// returns a 2 element array with the xy where the item will fit.
		Notes: Returns -1,-1 if no room in the location.
		Locations: 0 = inventory, 2 = player trade, 3 = cube, 4 = stash
		http://www.d2jsp.org/commandref/index.php#unit.getFreeSpace

	.	Added items[] = unit.getItems();	// returns an array of all the items that belong to 'unit'.
		Note: This works for players, NPCs, and even other items (ie, contains socketed gems/jewels/runes)
		http://www.d2jsp.org/commandref/index.php#unit.getItems

	.	Added units[] = unit.getNearUnits( int dist, int count, int type, [int modemask], [int collisionBitmask], [boolean noSort] );
		Returns an array of units within X range of the unit used.
		Note: You can specify a direct mode or modemask, see getUnit() for more info.
		Note: You can specify a collision flag between unit and dest. Equiv to checkCollision(unit,unit,collisionBitmask)
		Note: You can turn off the sorting by lowest dist first by passing true as the last param.
		Note: Pass null to any of the last 3 optional params to not use them.
		http://www.d2jsp.org/commandref/index.php#unit.getNearUnits

	.	Fixed a crash bug in checkCollision();
		If you passed an invalid XY for the area, it would crash.

	.	Fixed a crash bug in getRoom(area, x, y);
		If you passed an invalid XY for the area, it would crash.

	.	Added optional param to file.writeLine(str, [bool appendLF]);
		Pass false as the 2nd param to NOT append a linefeed to your file write.

	.	Fixed a crash bug in item.shop();
		If you attempted to shop while a warning dialog was up, it would crash.
		Example: Attempt to purchase an item, get not enough gold dialog, attempt to purchase it again, crash.
		Note: The core will just silently not perform the shop() command and return false.
		In order to cancel the dialog, you need to close out of trade at this time.

	.	Modified item.shop();	Removed NPC parameter requirement. You can still pass it, but it is ignored.
		Example usage:
		var SHOP_REPAIR=0, SHOP_SELL=1, SHOP_BUY=2;
		item.shop( SHOP_SELL );
		Note: Please update your scripts to use this, I will completely remove the npc parameter someday!
		http://www.d2jsp.org/commandref/index.php#unit.shop

	.	Added addDebugLog( String logLine );		// adds the string to the d2jsp.log file with a date/time stamp.
		Note: The line is automatically appended with a linefeed.
		http://www.d2jsp.org/commandref/index.php#

	.       Added merc = getUnit(102);	// returns a unit object for your mercenary, if you currently have one.
		http://www.d2jsp.org/commandref/index.php#getUnit

	.	Added SuperUniques to getBaseStat, use with the following: (useful for looking up classids from presetunitids)
		getBaseStat(25, id, index);
		See libs/base_superuniques.d2l for more information

	.	Fixed a bug in the initialization of the version image on startup.
		(Threading issue, was corrupting memory.)




version 0.49.53 - (05/05/2005) (hotfix)
	.	Updated md5sums of new harmless battle.net dlls




version 0.49 - (04/17/2005)
	.	Fixed an out of memory error with unit.gid;	// uses a number now instead of a double.

	.	Fixed an out of memory error with unit.getStat(13);	// uses a number now instead of a double.

	.	Fixed an out of memory error with me.gamestarttime;	// uses a number now instead of a double.

	.	Fixed an out of memory error with partyplayer.gid;	// uses a number now instead of a double.

	.	Removed double \\ from script filename load. Was confusing people, though had no ill-effects.

	.	Removed some old extraneous code. Old logic, and variables no longer used.

	.	Fixed a long standing bug where closing d2jsp while an out of game script was running would freeze Diablo II.
		Note: This means Alt-F4ing the game, or manually clicking the 'Quit' button.
		This also means quitGame() will function correctly now.

	.	Fixed a screenhook bug that wouldn't allow you to destroy a text screenhook by setting the text to ""

	.	Fixed a bug in screenhooks that would sometimes cause it to try to finalize the object twice.

	.	Fixed a bug in screenhooks where the malloc would sometimes generate an incorrect size.

	.	Removed an unused and unnecessary CriticalSection in the Event Handler

	.	Fixed a freeze bug in getRoom() if spidermonkey failed to create the object

	.	Fixed a freeze bug in runGC() that could sometimes occur if an event spawned during a runGC()

	.	Added blockMinimize( bool );	// set to 1 or true to block D2 from minimizing when it loses focus.
		Note: This will not bring d2 back into focus, if it is out of focus. (Thanks mousepad!)
		http://www.d2jsp.org/commandref/index.php#blockMinimize

	.	Added new event: EVENT_PLAYERSTAT;	// fires off whenever a player stat changes
		Use with: registerEvent( EVENT_PLAYERSTAT, playerStatEvent );
		Passes three params to the method: playerGID, statno, value
		http://www.d2jsp.org/commandref/index.php#EVENT_PLAYERSTAT

	.	Added new event: EVENT_NPCSTAT;		// fires off whenever a monster stat changes
		Use with: registerEvent( EVENT_NPCSTAT, monsterStatEvent );
		Passes three params to the method: monsterGID, statno, value
		http://www.d2jsp.org/commandref/index.php#EVENT_NPCSTAT

	.	Added new event: EVENT_ITEMSTAT;	// fires off whenever an item stat changes (eg, quantity)
		Use with: registerEvent( EVENT_ITEMSTAT, itemStatEvent );
		Passes three params to the method: itemGID, statno, value
		http://www.d2jsp.org/commandref/index.php#EVENT_ITEMSTAT

	.	Added getArea( [areaId] );	// areaId is optional, if not passed uses current area. Returns Area object.
		Note: If invalid areaid is passed (wrong act, etc), it will return undefined.
		http://www.d2jsp.org/commandref/index.php#getArea

	.	Added new Area Object, returned by getArea()	// gets information about an area
		http://www.d2jsp.org/commandref/index.php#area

	.	Added area.x;		// starting x coordinate of the area.
		Note: You need to *5 this value for the actual ingame size.
		http://www.d2jsp.org/commandref/index.php#area.x

	.	Added area.y;		// starting y coordinate of the area.
		Note: You need to *5 this value for the actual ingame size.
		http://www.d2jsp.org/commandref/index.php#area.y

	.	Added area.xsize;	// x size of the area
		Note: You need to *5 this value for the actual ingame size.
		http://www.d2jsp.org/commandref/index.php#area.xsize

	.	Added area.ysize;	// y size of the area
		Note: You need to *5 this value for the actual ingame size.
		http://www.d2jsp.org/commandref/index.php#area.ysize

	.	Added area.name;	// name of the area
		http://www.d2jsp.org/commandref/index.php#area.name

	.	Added arr = room.getNearby();	// returns an array of rooms that are near to this room (surrounding rooms.)
		http://www.d2jsp.org/commandref/index.php#room.getNearby

	.	Added path = getPath(int areaId, int x1, int y1, int x2, int y2, [boolean cleanPath]);	// returns a FULL PATH of coords from start to finish.
		Note: returns undefined if no path can be built.
		Note: areaId is the Starting area that the x1 and y1 coordinates reside in.
		path[index][0] is the X value, path[index][1] is the Y value
		For more info on this, contact me on the forums or IRC.
		- Thanks to mousepad for some ideas and opt tweaks!
		http://www.d2jsp.org/commandref/index.php#getPath

	.	Fixed a crash bug when having d2jsp loaded, but no script running in a new game, and you change areas.
		Note: Only occured if no script loaded on game creation. (Thanks for reporting I3Linker/TechnoHunter!)

	.	Added area.exits;	// returns an array of area id's that the area links to. (Thanks mousepad!)
		Note: Does not show red portals in act 5
		http://www.d2jsp.org/commandref/index.php#area.exits

	.	Fixed a crash bug in screenhooks, where if the screenhook was destroyed, and you tried accessing it later
		and it wasn't garbage collected yet, it would try to act on a null object.




version 0.48 - (03/28/05)
	.	EVENT_GAMEMSG now spawns for both in game and out of game scripts.

	.	Added me.logchicken;	// set to 1/true to enable logging of core chickening.
		Note: Logs to d2jsp.log
		http://www.d2jsp.org/commandref/index.php#me.logchicken

	.	Added me.logquit;	// set to 1/true to enable logging of any script using quit();
		Note: Logs to d2jsp.log
		http://www.d2jsp.org/commandref/index.php#me.logquit

	.	me.showexp; now supports 0/1 or true/false

	.	All logging to d2jsp.log now includes date and timestamps.

	.	Added me.logtimeout;	// set to 1/true to enable logging of any core quits due to me.gamelength being exceeded
		Note: Logs to d2jsp.log
		http://www.d2jsp.org/commandref/index.php#me.logtimeout

	.	Added isIncluded( fileName );	// returns true or false, if the fileName passed is included or not
		Note: Pass the same fileName you pass to include();
		http://www.d2jsp.org/commandref/index.php#isIncluded

	.	Fixed unit properties so they will return null if a unit is no longer valid/exists.
		Example: while(unit && unit.type!=null) { /* unit is valid */ }
		Note: type property was just used as an example, all properties will return null, so use whatever makes sense for your script

	.	Added new event: EVENT_AREACHANGE;	// fires off whenever your character changes areas
		Use with: registerEvent( EVENT_AREACHANGE, areaChangeEvent );
		Passes one param to the method: areaId
		http://www.d2jsp.org/commandref/index.php#EVENT_AREACHANGE

	.	Miscellaneous code cleanups and rewrites.

	.	Fixed a crash bug with setting screenhook text value

	.	Fixed a bug in EVENT_PLAYERMOVE that was causing it to fire too many events in single player (thanks mousepad!)
		Note: Will now fire correctly, one event per x or y moved.

	.	Fixed a bug in EVENT_NPCMOVE that was causing it to fire too many events in single player (thanks mousepad!)
		Note: Will now fire correctly, one event per x or y moved.

	.	Fixed a bug in EVENT_MISSILEMOVE that was causing it to fire too many events in single player (thanks mousepad!)
		Note: Will now fire correctly, one event per x or y moved.

	.	Added me.ladder;	// returns 0 if your character is NOT ladder, non-zero if they are. (thanks mousepad!)
		Note: Only works in game!
		http://www.d2jsp.org/commandref/index.php#me.ladder

	.	Fixed clickMap() so that it now correctly takes run/walk into consideration!

	.	Added quitGame();	// will attempt to completely close Diablo II (this is NOT a kill process!)
		Note: If Diablo II is frozen, or freezes during the quit, the process will still exist in memory.
		http://www.d2jsp.org/commandref/index.php#quitGame

	.	Fixed getStat(13);	// was overflowing when experience was too high for a javascript 'int'. Changed to double

	.	Rewrote all PartyPlayer methods and clickParty() to wrap them in CritSects
		Should make them completely solid. Was getting occasional reports of crashes still.

	.	Fixed a crash bug in sendCopyData() if a non-string was passed as the fourth parameter. (thanks for report Shrek_III!)

	.	Fixed a freeze/crash bug in events that used double values. Converting to a 'number' now instead of a double.

	.	Made some optimizations to the JS interrupt callback (event handler)

	.	Fixed playSound() volume bug, should play at appropriate sample volume now! (thanks mousepad!)

	.	Fixed playSound() crashing on -ns option for D2 (thanks mousepad!)

	.	Fixed Out of Memory error with getTickCount();	(thanks for reporting PSI_Orion and NiGhT.AnGeL!)
		Note: This was caused due to spidermonkey not freeing 'double' values correctly. Changed value to a 'number'.

	.	EVENT_KEYDOWN and EVENT_KEYUP now receive system key events.
		Note: Was not firing the events for F10 and Alt (thanks for report TechnoHunter!)

	.	Fixed a freeze bug in sendCopyData() when used in recursion; introduced in this version.

	.	Fixed a bug with sendCopyData() where the data structure being used was global.
		Note: Made it a locally malloc'd object, so as to not collide if multiple scripts use sendCopyData() at the same time.

	.	Added more safety checking to incoming WM_COPYDATA messages, to prevent malformed messages crashing d2jsp.

	.	Outgoing sendCopyData() now support empty strings to be sent (only a data command). Pass null for the 4th argument.
		Note: The application you're sending this to must support this!

	.	Fixed a timing bug in the core thread handling, that would result in the 'wait' count being off, thus freezing the game.
		Thanks for helping me debug this Shrek_III!!!! (Only seemed to freeze on him, not me)




version 0.47 - (02/25/05)
	.	Fixed a crash bug with runGC() that prompted me to remove it a few versions back.
		runGC() will now function again as intended.
		**Note: runGC() will NOT run inside a script event! It will simply ignore the call.

	.	Fixed a bug in rnd(), using the same value for hi and lo would cause a crash (thanks for report darkspirit!)

	.	Added me.charname;	// Returns the currently (or last) selected character name
		Note: Primary use is out of game, though it also works in game
		http://www.d2jsp.org/commandref/index.php#me.charname

	.	Added me.language;	// Returns the current locale language that the D2 is running.
		Note: Returns the 3 letter code Blizzard uses, eg: ENG for English
		http://www.d2jsp.org/commandref/index.php#me.language

	.	Fixed a bug with me.gamestarttime;
		Was returning as an int, instead of a double, and would sometimes wrap, truncating data

	.	Added getScript( null, threadId );	// gets a script based on threadId

	.	Added getScript( scriptName );		// gets a script based on matching script name (not exact! returns first 'match'!)
		**Note: This is essentially the same as checking instr() in javascript! Try to make your scriptName as specific as possible!

	.	Added getScriptCount( type );		// returns the number of script of "type" that are running
		Type values are: 0 = In Game, 1 = Out of Game, -1 = Both
		http://www.d2jsp.org/commandref/index.php#getScriptCount

	.	Fixed a bug in the script object, where a property would return the last value after the object was no longer valid (thanks for report  Darien!)
		All properties will now return null when the object is no longer valid.

	.	Fixed a crash bug in room.getCollision() that was caused by unrooted values that were garbage collected

	.	Fixed array creation for getMouseCoords() (potential crash hazard)

	.	Fixed a memory leak in getPresetUnits();

	.	Fixed a crash bug in getPresetUnits() that was caused by unrooted values that were garbage collected

	.	Fixed a crash bug in room.getPresetUnits() that was caused by unrooted values that were garbage collected

	.	Fixed a crash bug in control.getText() that was caused by unrooted values that were garbage collected

	.	Fixed a crash bug in getStat(-1) that was caused by unrooted values that were garbage collected

	.	Fixed a bug with me.getState( 30 ); // energy shield was not returning a valid number.
		Note: This was because the number is 1073741824 which wraps a javascript int.

	.	Changed unit.getState( state ); to return 0 or 1, instead of the numbers it was returning before.
		Note: The number returned was always a bit offset anyway. 0 means the state is off, 1 means it's on.

	.	Fixed a crash that was occuring with other applications running in the background (MSN)

	.	Added more error checking to units passed via clickMap() to hopefully prevent a missing data structure crash

	.	Rewrote clickMap() internal function to be thread safe. Will no longer crash on vanished units. (thanks for report  Shrek_III!)

	.	Fixed a crash bug in copyUnit() when attempting to copy a unit that no longer exists (thanks for report  Shrek_III!)

	.	Fixed clickMap() so that if you pass an invalid unit, it will use me.x and me.y instead to prevent mouse click locks and crashes

	.	Rewrote unit.move() to use the new clickMap() wrapper (safe code).
		Note: This function is deprecated, so don't use it!

	.	Rewrote unit.useSkill() to use new clickMap() wrapper (safe code).
		Note: This function is deprecated, so don't use it!

	.	Rewrote unit.useSkillAt() to use new clickMap() wrapper (safe code).
		Note: This function is deprecated, so don't use it!

	.	Completely rewrote unit.interact() to make it thread safe while still being backwards compatible.
		Note: Do not use unit.interact() without any parameters, use clickMap() instead!
		unit.interact( value ); is meant for the following:
		Accepting Player Trades, Grabbing Item To Cursor, Imbue/Socket/Personalize Quests, Taking Waypoints: eg waypoint.interact( areaId );



version 0.46.42 - (02/10/05) (hotfix)
	.	Added md5sums for new IX86Ver#.dll files (appeared first on west, repacks)



version 0.46 - (01/15/05)
	.	Fixed a bug with me.getSkill( 0 and 1 ) for expansion skills (Druids, Assassins)
		Was not returning the correct skill name

	.	Fixed a bug with me.setSkill( SkillName ) for odd and expansion skills (Druids and Assassins)
		Was not using the correct proper skill name
		*Note: You should always use the skillId instead of the name, so your script is international

	.	Added new event: EVENT_WINDOWFOCUS;	// fires off whenever the window gains/loses focus
		Use with: registerEvent( EVENT_WINDOWFOCUS, windowFocusMsg );
		*Note: Returns 0 if D2 loses focus, 1 if D2 gains focus
		http://www.d2jsp.org/commandref/index.php#EVENT_WINDOWFOCUS

	.	Added new event: EVENT_MELIFE;		// fires off whenever your life or mana changes!
		Use with: registerEvent( EVENT_MELIFE, meLifeMsg );
		Passes two params to the method: life, mana
		http://www.d2jsp.org/commandref/index.php#EVENT_MELIFE

	.	Moved HP and MP chicken checks before the event catcher above, so it will fire only as needed, and immediately
		This will result in much faster core chickening

	.	Added PetType to getBaseStat, use with the following: (useful for the getMinionCount() function)
		getBaseStat(24, id, index);
		See libs/base_pettype.d2l for more information

	.	Added new event: EVENT_PLAYERSTATE;	// fires off whenever a state is changed on a player
		Use with: registerEvent( EVENT_PLAYERSTATE, playerStateMsg );
		Passes three params to the method: gid, stateno, value
		http://www.d2jsp.org/commandref/index.php#EVENT_PLAYERSTATE

	.	Added new event: EVENT_NPCSTATE;	// fires off whenever a state is changed on an NPC/Monster
		Use with: registerEvent( EVENT_NPCSTATE, monsterStateMsg );
		Passes three params to the method: gid, stateno, value
		http://www.d2jsp.org/commandref/index.php#EVENT_NPCSTATE

	.	Added new event: EVENT_MISSILESTATE;	// fires off whenever a state is changed on a missile
		Use with: registerEvent( EVENT_MISSILESTATE, missileStateMsg );
		Passes three params to the method: gid, stateno, value
		http://www.d2jsp.org/commandref/index.php#EVENT_MISSILESTATE

	.	Added new overload to getScript( [1] );	// if you pass 1 (optional), will return the current script
		Useful if you want to send messages to yourself to raise 'custom' events.

	.	Fixed a crash bug in PartyPlayer.properties. There was no null checking on a player that has left the game

	.	Removed event: EVENT_UNITMOVE (see below)

	.	Added new event: EVENT_PLAYERMOVE;	// fires off whenever a player moves
		Use with: registerEvent( EVENT_PLAYERMOVE, playerMoveMsg );
		Passes three params to the method: gid, x, y
		http://www.d2jsp.org/commandref/index.php#EVENT_PLAYERMOVE

	.	Added new event: EVENT_NPCMOVE;	// fires off whenever a monster/npc moves
		Use with: registerEvent( EVENT_NPCMOVE, npcMoveMsg );
		Passes three params to the method: gid, x, y
		http://www.d2jsp.org/commandref/index.php#EVENT_NPCMOVE

	.	Added new event: EVENT_MISSILEMOVE;	// fires off whenever a missile moves
		Use with: registerEvent( EVENT_MISSILEMOVE, missileMoveMsg );
		Passes three params to the method: gid, x, y
		http://www.d2jsp.org/commandref/index.php#EVENT_MISSILEMOVE

	.	Added new event: EVENT_NEWNPC;		// fires off whenever a new monster/npc comes into view
		Use with: registerEvent( EVENT_NEWNPC, newNPCMsg );
		Passes three params to the method: gid, classid, mode
		http://www.d2jsp.org/commandref/index.php#EVENT_NEWNPC

	.	Added new event: EVENT_NEWITEM;		// fires off whenever an item action takes place, item comes into view, new item dropping, clicking items, etc
		Use with: registerEvent( EVENT_NEWITEM, newItemMsg );
		Passes three params to the method: gid, mode, flag
		http://www.d2jsp.org/commandref/index.php#EVENT_NEWITEM

	.	Added new event: EVENT_NPCLIFE;		// fires off whenever an NPC/monster's life changes
		Use with: registerEvent( EVENT_NPCLIFE, monsterLifeMsg );
		Passes three params to the method: gid, life
		http://www.d2jsp.org/commandref/index.php#EVENT_NPCLIFE

	.	Fixed a bug with all the new event handlers that used a 'gid' value. Was using int, should have been double

	.	Fixed bug with setMinimized(), was causing Diablo II to freeze when used




version 0.45 - (12/18/04)
	.	Fixed screenhook.color bug, where it was not using the color for text. (signed/unsigned mismatch)

	.	Misc code cleanups and rewrites

	.	Added Gems to getBaseStat, use with the following:
		getBaseStat(22, id, index);
		See libs/base_gems.d2l for more information (please note this is patch_d2.mpq data only)

	.	Added Experience to getBaseStat, use with the following:
		getBaseStat(23, id, index);
		See libs/base_experience.d2l for more information (please note this is patch_d2.mpq data only)

	.	Fixed getBaseStat() to return certain large unsigned values correctly (ex; experience table)

	.	Added unit.getMinionCount( minionType ); // returns the # of minions of this type you currently have
		Example: me.getMinionCount( 4 ); // returns the number of necro skeletons you have
		http://www.d2jsp.org/commandref/index.php#unit.getMinionCount

	.	Removed the 25 line limit on getText() for out of game controls.

	.	Added partyPlayer.partyflag property.	Returns the following values:
		0 = Invite (no invites for this person, invite them to the party)
		1 = None   (cannot invite this person, they are already in a party, or this is you)
		2 = Cancel (you invited them)
		4 = Accept (they invited you)
		http://www.d2jsp.org/commandref/index.php#party.partyflag

	.	Fixed clickParty() on inviting people, if the person cannot be invited, will not let you invite them (crash fix)

	.	Added partyPlayer.squelched property. Returns 0 if the player is squelched, 4 if the player is not squelched.

	.	Added partyPlayer.ignored property. Returns 0 if the player can hear you, 2 if the player cannot hear you (ignored)

	.	Fixed player trading bugs, no longer crashes, all properties return as intended.

	.	Fixed trade crash with acceptTrade(); Will no longer crash if "out of trade".
		This also now toggles the trade tick from accept to not accept, etc..

	.	Fixed trade crash with player.interact(1); when no trade request dialog was up

	.	Added getTradeInfo( mode );	// returns various trade informations, where mode = ..
		0 = Return General Trade Mode, returns: 0 = no trade, 1 = requested trade, 2 = waiting for you to accept trade, 3,5,7=in trade
		1 = Return Trading Recipients Name (if not in trade, returns last traders name)
		2 = Return Trading Recipients Global ID (if not in trade, returns last traders id)
		http://www.d2jsp.org/commandref/index.php#getTradeInfo

	.	Added new event: EVENT_UNITMOVE;	// fires off whenever any unit moves!
		Use with: registerEvent( EVENT_UNITMOVE, unitMoveMsg );
		http://www.d2jsp.org/commandref/index.php#EVENT_UNITMOVE

	.	Fixed a crash bug in the event handler.
		If a script terminated with pending events that had 'rooted' values, it would crash

	.	Added sendSound( soundId );	// plays the selected sound effect, emulating the numeric pad 0 to 7 keys
		**Note: Only values 25 to 32 work. They send the sound for your character:
		25 = Help, 26 = Follow Me, 27 = This Is For You, 28 = Thank You, 29 = Oops, 30 = Goodbye, 31 = Die, 32 = Run
		Example: sendSound( 25 ); // Sends the play sound message for "Help Me!"
		http://www.d2jsp.org/commandref/index.php#sendSound

	.	Added playSound( soundId );	// plays any sound listed in the sounds.txt table (by id)
		**Note: currently plays at the default background noise volume level, volume control will be a later feature
		http://www.d2jsp.org/commandref/index.php#playSound

	.	Added createDirectory( directory );	// creates the directory specified, starting directory is scripts/
		Returns true/false, true if the directory creation succeeds.
		Example: createDirectory( "output/MyBot" ); // creates the directory MyBot in the output folder
		http://www.d2jsp.org/commandref/index.php#createDirectory

	.	Added new event: EVENT_QUEST;	// fires off whenever there are any event changes!
		Use with: registerEvent( EVENT_QUEST, questMsg );
		http://www.d2jsp.org/commandref/index.php#EVENT_QUEST




version 0.44 - (10/02/04)
	.	Added screenHook.sendToFront();		// causes the z-order of the screenhook to be the last drawn (on top)
		http://www.d2jsp.org/commandref/index.php#screen.sendToFront

	.	Added screenHook.sendToBack();		// causes the z-order of the screenhook to be the first drawn (on bottom)
		http://www.d2jsp.org/commandref/index.php#screen.sendToBack

	.	Added constructors to getScreenHook();	// see examples as follows, each param is optional
		Base Syntax: getScreenHook( [String text [, int x [, int y [, int x2 [, int y2 [, int color [, int font [, int type [, int opacity]]]]]]]]] );
		Example1: getScreenHook( "hello", 100, 100 );	// sets hello text screenhook to 100,100
		Example2: getScreenHook( "", 50, 50, 75, 75, 0x20, 0, 1 );	// draws a box at 50,50,75,75, of white color and default opacity
		Example3: getScreenHook( "text w/ diff font", 100, 100, -1, -1, 0, 4 );	// uses the #4 font instead of the default
		http://www.d2jsp.org/commandref/index.php#getScreenHook

	.	Fixed screenhook text crashing on color range outside of -54 to 20

	.	Added sendCopyData( String windowClass, String windowName, int modeId, String data );	// used to send WM_COPYDATA commands
		Note: This is a very advanced feature. The primary reason for adding it was to replace DDE in autod2jsp.
		Example: sendCopyData( "autod2jsp", 0, 2, "This will add a log entry to autod2jsp." );
		http://www.d2jsp.org/commandref/index.php#sendCopyData

	.	Added a WM_COPYDATA catcher in the core. Will now process WM_COPYDATA messages.
		Id 1 = Execute as a script, Id 2 = Broadcast as a message to running scripts.
		lpData must be a pointer to a valid char * to execute or broadcast.
		Note: This is a very advanced feature. The primary reason for adding it was to replace DDE in autod2jsp.

	.	Added WM_COPYDATA broadcast event and constant EVENT_COPYDATA for use with registerEvent
		http://www.d2jsp.org/commandref/index.php#registerEvent

	.	Fixed a possible threading issue related to calling runGC() on multiple scripts at the same time

	.	Added Runes to getBaseStat, use with the following: (runewords)
		getBaseStat(20, id, index);
		See libs/base_runes.d2l for more information (please note this is patch_d2.mpq data only)

	.	Added Cubemain to getBaseStat, use with the following: (cube recipes)
		getBaseStat(21, id, index);
		See libs/base_cubemain.d2l for more information (please note this is patch_d2.mpq data only)

	.	Fixed an introduced bug where the Script Error wasn't displaying properly.

	.	Updated the script error message, and it now dumps the offending line into the d2jsp.log file.

	.	Fixed Garbage Collecting issue with events that caused core crashes when running the garbage collector



version 0.43 - (08/16/04)
	.	Add item.itemid;		// returns the Set or Unique ID of the item (used with getBaseStat())
		http://www.d2jsp.org/commandref/index.php#unit.itemid

	.	Added room.unitInRoom( unit );	// returns true or false, depending if the unit is in the room or not
		Note: Works for all unit types, players, items, objects, etc
		http://www.d2jsp.org/commandref/index.php#room.unitInRoom

	.	Added blockEvent( EVENT_ID, true/false );	// blocks the event you request from Diablo II, set to true to block, false to unblock
		Note: This works in and out of game, and doesnt get reset between games.
		Note: Scripts still get the events, so you can script blockers or GUIs relatively easily now.
		Valid events: EVENT_MOUSEDOWN, EVENT_MOUSEUP, EVENT_KEYDOWN, EVENT_KEYUP
		http://www.d2jsp.org/commandref/index.php#blockEvent

	.	Added setMinimized( true/false );	// minimizes or restores the d2 window
		Set to true to minimize, false to restore
		Works in and out of game
		http://www.d2jsp.org/commandref/index.php#setMinimized

	.	Added me.minimized;			// returns true or false if the window is minimized or not
		Works in and out of game
		http://www.d2jsp.org/commandref/index.php#me.minimized

	.	Misc. code cleanups and optimizations

	.	Added beep( int beepType );				// Creates a system speaker beep
		beepTypes:
		0 = Simple beep. If the sound card is not available, the sound is generated using the speaker.
		1 = MB_ICONASTERISK - SystemAsterisk
		2 = MB_ICONEXCLAMATION - SystemExclamation
		3 = MB_ICONHAND - SystemHand
		4 = MB_ICONQUESTION - SystemQuestion
		5 = MB_OK - SystemDefault
		http://www.d2jsp.org/commandref/index.php#beep

	.	Added ignore for System Debug Info v1.06 dll

	.	Fixed some more random crashes/odd occurances

	.	Fixed d2jsp freeze on detach (Extrawork protection), d2jsp will now successfully detach as appropriate

	.	Fixed control click problems introduced in this version (only some experience this)



version 0.42 - (07/30/04)
	.	Fixed a crash some people were experiencing after immediately attaching d2jsp (thanks mousepad!)

	.	Cleaned up and fixed some out of game code, should be much much more stable now (hopefully 100%)

	.	Fixed the jsArray creation routines in the core, which fixes crashes:
		getText()
		getRoom() and all related room property methods that return an array

	.	Manually detaching d2jsp should always work now, fixed a bug that could cause it to freeze lock

	.	Fixed a crash in getCollision() that occured occasionally
		(if collision data fails, the function will return null)

	.	Added [width,height] = getTextWidthHeight( String text, int font );
		returns a 2d array with the width and height of the string. Useful for drawing borders around screenhook text
		http://www.d2jsp.org/commandref/index.php#getTextWidthHeight

	.	Added control.maxlength;	// returns the max length an edit box will accept for a string
		**Note: This includes the null terminator, so for script purposes you need to subtract 1 from this value.

	.	You can no longer insert strings longer than the maximum length of an edit box into an edit box

	.	control.disabled now returns for all controls, not just buttons

	.	d2jsp.exe now pops up message box alerts when using command line params (-install)

	.	Added file = fileOpen( String fileName, String openMode );	// overload, you can now specify the exact open mode you want
		*Note: This allows you to specify a binary read/write mode, eg; "rb"
		http://www.d2jsp.org/commandref/index.php#fileOpen

	.	Added int = file.getc();	// get's the next character in the file stream (useful for binary reading)
		http://www.d2jsp.org/commandref/index.php#file.getc

	.	Added file.putc( int byte [, int byte..] );	// puts the int chars you specify onto the file stream (write)
		**Note: You can pass multiple ints (comma seperated), to pass multiple characters in one call
		**Note: This is most useful for binary writing
		http://www.d2jsp.org/commandref/index.php#file.putc

	.	Added new screenhook type: IMAGE = 2

	.	Added new screenhook property: screenhook.image;	// allows you to set the image for a screenhook
		http://www.d2jsp.org/commandref/index.php#screen.image

	.	Added .bmp screenhook support, set with screenhook.type = 2; and screehook.image = "fileName.bmp";
		**Note: Use the x and y properties to set the position
		**Note: Works in and out of game

	.	Wrapped all screenhook stuff in CriticalSections instead of volatiles

	.	Wrapped setThreadPriority() in a CriticalSection, was sometimes causing a freezeup under certain conditions

	.	Added image border around d2jsp version (thanks to rizarjay for image!)

	.	Fixed a bug in the core where if you passed a UNIT_PLAYER name into getUnit, it would never match it
		**Note: This fixes the corpse = getUnit( 0, me.name, 17 ); not working bug

	.	mouseclickHandler() events now spawn out of game to out of game scripts.

	.	Completely revamped all events, they are now on a subscription basis:

	.	Added registerEvent( EVENT_ID, yourFunction );		// registers an event to your function
		Example: function mouseDown( b ) { .. }; registerEvent( EVENT_MOUSEDOWN, mouseDown );
		See tools/eventHandler.d2j for complete examples of all events
		**Note: Pass 0 as the second parameter to unregister an event.
		http://www.d2jsp.org/commandref/index.php#registerEvent

	.	Added the following constants (which are associated to EventIDs):
		EVENT_MOUSEDOWN			0
		EVENT_MOUSEUP			1
		EVENT_KEYDOWN			2
		EVENT_KEYUP			3
		EVENT_GAMEMSG			4
		EVENT_HOSTILEMSG		5
		EVENT_PARTYMSG			6
		EVENT_INPUTLINE			7
		EVENT_CHATMSG			8
		EVENT_SCRIPTMSG			9
		**Note: The actual values are subject to change at any time, so just use the actual CONSTANT, eg:
			registerEvent( EVENT_KEYDOWN, keyDown );

	.	getMouseCoords(); now works out of game. The optional '1' param does NOT apply to out of game.

	.	Fixed a threading crash when using free() on ended scripts

	.	Fixed some incorrect implementations of the DDE server

	.	Added getRepairCost( npcClassId );	// returns the Repair All cost based upon the given npc.
		*Note: Will crash if you use an invalid classid, so use 0x9A if you don't have an id.
		http://www.d2jsp.org/commandref/index.php#getRepairCost

	.	Fixed a very obscure freeze bug introduced during some of the out of game optimizations

	.	Updated uniqueitems BaseStats, was missing a value (WORD namestr)

	.	Updated setitems BaseStats, was missing two columns, WORD namestr, and version

	.	Fixed a bug with me.mercrevive where it would sometimes return non zero when the mercenary was alive

	.	Fixed sgUIState.hDialogWaiting crash
		**Note: Shopping too fast was causing a crash, this is prevented in the core

	.	Cleaned up the skill select code to prevent some random crashes that were occuring (memory violations)
		**Note: This can still occur if you use get/setSkill based on skill name, so use skillId



version 0.41 - (06/30/04)
	.	The sgUIState.hDialogWaiting == NULL error should now occur much less frequently (still trying to find all causes)

	.	d2jsp now blocks Ad download and display on the battle.net chat/lobby.
		Note: If you attach d2jsp after you are already on bnet,
			it will always display the last ad that was downloaded,
			but not download another new ad.

	.	Fixed getStat(-2) multiple substat not returning bug	(thanks for reporting Muellsammler)
		Should now return multiple substats correctly (HoTO, CTA, etc)

	.	Miscellaneous code cleanups and rewrites

	.	Extended screenhooks, adding the follow properties:
		int screenhook.type;		// type of object, 0 = line, 1 = box
		int screenhook.opacity;		// opacity of object, 0 = transparent, 0xff = opaque, default is 0xff

	.	Added new screenhook type, box.
		Set with screenhook.type = 1;
		Make sure to set your x, y, x2, and y2 values for it to draw.

	.	Incoming DDE commands are now parsed as either InGame or OutOfGame depending on the state of the game
		- d2jsp used to block all DDE commands if out of game, and only process in game DDE.

	.	item.description now returns the item description text for items on the ground. (thanks mousepad!)

	.	unit.overhead( String ) now works for all players, NPCs, and Object objects (unit types 0, 1, 2)

	.	You can now set me.gamefilename in-game

	.	If you set me.gamefilename = ""; no file load attempt will take place when entering a new game, or typing .start

	.	d2jsp version now displays out of game

	.	getScreenHook() now works out of game

	.	takeScreenshot() now works out of game

	.	getLocaleString() now works out of game

	.	Added room.type;	// Returns the Preset Type Id of the room



version 0.40 - (06/01/04)
	.	Added me.miscscreenmode; // returns (int) the misc screen mode. (thanks mousepad)
		This is useful for finding out if certain dialogs are open, such as the trade with player confirmation dialogs
		or Sell Confirm dialogs.
		See sdk/miscscreenmodes.txt for a listing of all the known modes.

	.	Added me.golddialog;	// returns true/false if the gold dialog is up (thanks mousepad)

	.	Added new mouse click event handler:
		function mouseclickHandler( button ) { ... }
		Returns 0 for left, 1 for right, or 2 for middle if the button was clicked. Use getMouseCoords() to get coordinates for regional click handling.

	.	Fixed getRating();
		Was not correctly updated to 1.10, should work correctly now.

	.	Added a [script] object.

	.	Added script = getScript();	// use this to get the first running script

	.	Added script.getNext();		// use this to get the next running script

	.	Added script.stop();		// stops this specific script. This object will then expire and must be reaquired with getScript()

	.	Added the following script properties:
		script.name;		// returns the filename (or last included file for the script) or script buffer if a .exec script
		script.threadid;	// returns the threadid of the running script
		script.running;		// returns 0 or 1 if the script is running - debug only, you will almost never see this as 0
		script.gametype;	// returns 0 if the script is in game, or 1 if the script is out of game (starter.d2j)
		script.abort;		// returns 0 or 1 if the script is in the process of terminating - debug only

	.	Added new script communication handler
		function scriptmsgHandler( msg ) { ... }
		See below for ways to use this.

	.	Added script.send( msg );	// sends a text message to the script object

	.	Added scriptBroadcast( msg );	// sends a text message to all running scripts

	.	Changed [script object] references to be based upon a new unique identifier stored within the core.
		Using the ThreadId was causing conflicts on Windows 98 machines. (thanks Muellsammler!)

	.	Added assoc_array = unit.getStat(-2);	// returns a complete list of all the stats and substats a unit has (Thanks mousepad)
		- Use this to get an associate array listing of all stats a unit has. Example return for +10 energy item:
		print(retval[1][0]); would be 10 (stat 1 is energy, substat value 0).
		- See tools/statEnumerator.d2j for an example script on looping through all stats
		This method will return all runeword stats on items!

	.	Added checksum for safe IX86ExtraWork.mpq (System Debug Info 1.05)



version 0.39 - (04/02/04)
	.	Fixed getPlayerFlag() for players not on your screen. Was returning null if the player was not on your screen.

	.	Fixed a bug with unit.gid that would cause it to return an incorrect value.

	.	Fixed a bug with party.gid that would cause it to return an incorrect value.

	.	Fixed getTickCount() to return the full unsigned 32 bit value.

	.	Fixed getUnit(x, y, z, gid); to allow full range of gids

	.	Fixed getPlayerFlag() to allow full range of gids

	.	Fixed getParty() to allow full range of gids

	.	Added CharStats to getBaseStat, use with the following:
		getBaseStat(15, id, index);
		See libs/base_charstats.d2l for more information

	.	Added SetItems to getBaseStat, use with the following:
		getBaseStat(16, id, index);
		See libs/base_setitems.d2l for more information

	.	Added UniqueItems to getBaseStat, use with the following:
		getBaseStat(17, id, index);
		See libs/base_uniqueitems.d2l for more information

	.	Added Sets to getBaseStat, use with the following:
		getBaseStat(18, id, index);
		See libs/base_sets.d2l for more information

	.	Added unit.getStat( -1 ); // returns an array of all stats in the format: [statindex, substatindex, value];

	.	Added item.description;	// returns full string of item description, exactly like D2 Displays

	.	Added me.gamefilename;	// You can now set what filename it loads when you enter a game. Default is still default.d2j
		Note: This can only be set out of game, but it can be read in or out of game.

	.	Rewrote getBaseStat() function to be much more dynamic (for easy adding of new base stat lookups) (Thanks mousepad!)

	.	Added ItemTypes to getBaseStat, use with the following:
		getBaseStat(19, id, index);
		See libs/base_itemtypes.d2l for more information



version 0.38 - (02/02/04)
	.	Added me.getSkillDamageMin( skillID, skillLvl );	// returns total min damage for skill at that skill level
		*Note: You must bitshift both min and max values by 8. Ex: me.getSkillDamageMin(64, 20) >> 8;  would return frozen orb min @ lvl 20

	.	Added me.getSkillDamageMax( skillID, skillLvl );	// returns total max damage for skill at that skill level
		*Note: Both min and max take into consideration all synergies
		*Note: This does not return values for physical damage based skills (ex/ Attack)

	.	Fixed crash bug in room functions (invalid ptr occasionally, threading issue)

	.	include() now only includes once. This prevents cross includes from occuring.

	.	Added ItemStatCost to getBaseStat, use with the following:
		getBaseStat(7, statid, index);
		See libs/base_itemstatcost.d2l for more information

	.	Added Levels to getBaseStat, use with the following:
		getBaseStat(8, areaid, index);
		See libs/base_levels.d2l for more information

	.	Added Leveldefs getBaseStat, use with the following:
		getBaseStat(9, areaid, index);
		See libs/base_leveldefs.d2l for more information

	.	Added LvlMaze to getBaseStat, use with the following:
		getBaseStat(10, areaid, index);
		See libs/base_lvlmaze.d2l for more information

	.	Added LvlSub to getBaseStat, use with the following:
		getBaseStat(11, areaid, index);
		See libs/base_lvlsub.d2l for more information

	.	Added LvlWarp to getBaseStat, use with the following:
		getBaseStat(12, areaid, index);
		See libs/base_lvlwarp.d2l for more information

	.	Added LvlPrest to getBaseStat, use with the following:
		getBaseStat(13, prestid, index);
		See libs/base_lvlprest.d2l for more information

	.	Added LvlTypes to getBaseStat, use with the following:
		getBaseStat(14, areaid, index);
		See libs/base_lvltypes.d2l for more information

	.	Added more safe hashes for version check dlls (useast)

	.	Fixed some out of game crashes caused by attaching in game

	.	Added control.click(x, y); as an optional overload.
		This is needed for realm selection, and scrollbar usage.

	.	Fixed a crash in the 8 parameter getCollision();



version 0.37 - (01/24/04)
	.	Out of Game scripts now run even while in game.

	.	Added me.ingame; // returns true or false to determine if you're in a game

	.	Fixed Remove and Install/Update	crashes! Woo!

	.	Fixed sendDDE() bug.

	.	Fixed a very random crash (thread issue) caused by use of getParent() and clickItem()

	.	Fixed a random crash related to getRoom() and .getNext() and .getFirst()

	.	Fixed couple thread related crashes

	.	Added me.windowtitle;	// returns the title of the Diablo II d2jsp is attached to.
		*Note: Useful if you want to set up configurations (starter.d2j or default.d2j) on a per Title basis
		*Note: Will only return a max of 63 characters.



version 0.36 - (01/19/04)
	.	Fixed numerous core crashes from 0.35.36

	.	Fixed core bug that wouldnt allow you to .click() any out of game controls other than buttons
		(Character Select selection bug fixed, caused by this)

	.	Fixed inventory clicking bug, where you had to open inventory once before clicking it would work

	.	Added me.ip;		// returns a string with your local machines IP in it

	.	Added me.gameserverip;	// returns a string with the current game servers IP in it

	.	Fixed bug in getParty() -> getNext() that would never return 'null', and thus continue forever
		This only applies to while looping the party.getNext(), it'll only return true while there is a new object found

	.	Fixed bug in getParty() on the realms

	.	Added me.gamename;	// returns the name of the game you are currently in

	.	Added me.gamepassword;	// returns the password of the game you are currently in

	.	Added me.realmshort;	// returns the realm you are on, short version. example: USEast

	.	Fixed clickParty();	// all modes were crashing, loot, hostile, party, leave party all fixed.

	.	Fixed gold();		// all modes and amounts work correctly again
		prototype: gold(amount, mode);	// mode 1 = drop, 2 = inventory to trade, 3 = inventory to stash, 4 = stash to inventory

	.	Fixed skills not casting problem when cursor is over bottom panel. (thanks mousepad!)

	.	Fixed party.getNext();	// was returning false always, thanks for reporting Darien!



version 0.35 - (1/15/04)
	.	Added getPresetUnits(area, type, id, roomid-array);
		roomid-array is an array of roomids (int). Will return an array of preset units with the matching parameters.

	.	Fixed (re-added) item.itemclass to return 0, 1, or 2 for normal, exceptional, or elite

	.	Added out of game contexts! Big thanks to mousepad for all his help reverse engineering the out of game stuff!

	.	Added getControl([type, x, y, xsize, ysize]); // returns out of game control
		If you pass the params, it will try and match a control directly.

	.	Added control.getNext(); // gets next control, used for enumerating controls.

	.	Control properties: type, x, y, xsize, ysize, text, visible, disabled

	.	Made a core optimization to room.getPresetUnits();

	.	Fixed random cursor movements when D2 is minimized!! Thanks mousepad!!

	.	You can now run single player minimized (botting), and get through the char select screen minimized! Thanks mousepad!

	.	Added chatmsgHandler(msg); // will fire every time new text appears in the chat text box. Applies to out of game scripts only.

	.	Added inputlineHandler(msg); to out of game scripts.

	.	Added me.gamelength;	// set this to any number in milliseconds, and d2jsp will quit if the game time exceeds this amount.
		Set this to 0 to disable game length quitting.

	.	Script errors now (possibly temporarily) output the error to d2jsp.log in your Diablo II folder.

	.	Completely rewrote SpiderMonkey and thread interactions and logging/storage. This should produce a huge speed increase.

	.	Fixed pszFileName[] crash, where if you minimized while changing acts, then unminimized it would crash. Thanks mousepad!

	.	Fixed delay(); bug where if you passed a negative number, it would sleep lock forever. Thanks for help debugging TDW.

	.	Added getBaseStat(5, classid, index); // Missile Base Stats!

	.	Updated for Diablo II 1.10 (thanks mousepad for help finding some of the new offsets/functions)

	.	Added monster.spectype property. Returns the following in a bitmask form:
                        0x00	Normal Monster
			0x01	Super Unique
			0x02	Champion
			0x04	Boss
			0x08    Minion

	.	Added getBaseStat(6, classid, index); // MonStats2 Base stats! (thanks mousepad)

	.	getBaseStat() now returns 0 or 1 for bit fields.

	.	Added getStat(index, [sub index]);	// this is needed for new 1.10 stats, does a system lookup for certain stats
		Examples:
		item.getStat(18, 0);	// gets enhanced damage final value
		item.getStat(83, 1);	// gets + to sorc skills (sub index = class code, 0=amazon, 1=sorc, etc, see sdk/stats_chars.txt)
		item.getStat(107, 6);	// gets + to magic arrow (sub index = skill id, see sdk/skills.txt)
		item.getStat(188, 33);	// gets + to barbarian masteries tab (sub index = tab id, see sdk/stats_tabs.txt)
		Notes:
		* This new param is only needed for a select few stats, for a majority of the rest, you can still pass 1 param.
		* It's actually much faster to pass only 1 param than 2, so use the old everywhere you can.
			- will add caching to a later version of d2jsp

	.	Fixed some miscellaneous crashes

	.	Fixed getParty() related crashes (GetPartyPlayer is no longer valid in D2)



version 0.34 - ()
	.	Added checkCollision(unit1, unit2, bitmask); // returns if units have line of sight to each other
		Bitmask:
			bit 0 : block walk
			bit 1 : block light + block Line Of Sight (the possibility to see monsters)
			bit 2 : block jump (and teleport I believe)
			bit 3 : block Player's walk but not Mercenary's walk (weird)
			bit 4 : ?
			bit 5 : block light only (not LOS)
			bit 6 : ?
			bit 7 : ?
		Return 0 or 1. 0 = Has Line Of Sight, 1 = Does NOT Have Line Of Sight

	.	Added checkCollision(area, x, y, bitmask); // checks the particular's x,y collision data according to the bitmask

	.	Added checkCollision(area, x1, y1, size1, x2, y2, size2, bitmask); // returns two x y locations line of sight

	.	Added checkCollision(area, x, y, pattern, bitmask); // checks the particular x,y pattern against bitmask

	.	Added getRoom(area, [x, y]); // overload, you can now specify x and y within a area, and return a specific room.

	.	Removed 1023 character limit on file.readLine(); You can now read in large lines, assuming you have enough ram to do so.

	.	Changed all print type calls to pass Unicode only. This should solve all the color issues with non-english installs.

	.	Cleaned up Classes, using inheritance for each object type (units). This should add better performance for large amounts
		of objects.

	.	Added getCursorType([optional 1]); // returns the cursor type of your cursor, pass one to see "Shop Mode" cursor types.
		Regular Modes: 1 = regular, 3 and 4 = item on cursor, 6 = id scroll, 7 = shop cursor
		Shop Mode (7): 1 = regular, 2 = repair, 3 = buy, 4 = sell
		-- thanks mousepad

	.	Completely rewrote File Handling routines for the file functions within scripts. The data is better encapsulated now,
		and easier to manage in the core.

	.	Fixed sendDDE() bug. Would stop sending commands on the 128th send.

	.	Fixed D2 Freeze on quit while certain scripts were running (sendDDE). Thanks mousepad!

	.	Fixed crash bug with new fileio structures. Thanks for report mattlant

	.	Fixed sendDDE() incompatabilities.

	.	Added getTickCount(); // returns current tick time in millisecond form

	.	Added me.gamestarttime;	// returns the time in ms that the game started (from GetTickCount())

	.	Fixed a detection bug in Player Trade clickItem()

	.	Fixed bug in me.chickenhp and me.chickenmp that wouldn't allow it to be set over 127. Thanks for reporting scavenger!
		This is a long standing bug that has been in d2jsp at least since the beginning when it was first added. Hopefully this
		will solve all the "not chickening" reports. Sorry about this everyone.

	.	Added me.mercnamestr;	// returns the locale string number of your merc, of 65535 if they are alive.
		You can get the actual name with: print(getLocaleString(me.mercnamestr));
		** Note: This only returns a valid # if your mercenary is dead!

	.	Added me.mercrevive;	// returns the revive cost of your mercenary, if it is dead, otherwise returns 0

	.	Added getBaseStat(4, ...); // returns Object base stats. See base_objects.d2l for full details

	.	Added item.getItemCost(mode, [npc_classid]); // optionally overload the npc classid to get the cost while outside of trade

	.	Updated getParty([gid]) to truly allow the "global id" of a player to be optional. If no params, will default to your gid.

	.	Fixed crash on passing a null object to clickParty();	--thanks for reporting TDW

	.	Added additional getUnit() overload: getUnit(type, [name/code/classid], [mode], [global_id]);
		You can now directly grab a unit from their global id, example: me_clone = getUnit(0, null, null, me.gid);
		** Note: Using getNext() after this will probably not produce any usable results.
		** Note: classid/mode are ignored if you pass a global id!

	.	Added overload to getUnit(type, [..], [mode], [..]); You may now pass a mode mask to have the core check multiple modes.
		To use this, set the 30th bit to 1, then any other modes' bit index to 1 that you want the core to mask.
		Example to return any dead monster, modes are 0 for death, 12 for dead.
		dead_unit = getUnit(1, null, (1<<29) | (1<<0) | (1<<12));
		** Note: THIS DOES NOT WORK ON ANY MODES GREATER THAN 28! Example: Does NOT work on item modes 100+, or 200+!

	.	If javascript engine runs out of memory, it will now terminate the script that generated the error message.
		Scripts that had me.quitonerror=1; set will still exit like always.

	.	Fixed some more misc core crashes related to scripts terminating prematurely.

	.	Fixed some crashes related to fileOpen() if the file did not exist. --Thanks TDW!

	.	Re-updated the base stats for Skills and Monstats.




version 0.33 - (9/9/2003)
	.	Made numerous function fixes to increase performance and reliability and reduce chances of detection.

	.	Added clickMap(); // calls click functions inside d2 (not real mouse clicks, but the function called by clicking)
		clickMap(clickType, shiftKey, Unit);
		clickMap(clickType, shiftKey, x, y);
		clickType = 0 left down, 1 left hold, 2 left up, 3 right down, 4 right hold, 5 right up
		shiftKey = 0 or 1 (shift off or on)
		*This function replaces the following commands: move, useSkill, useSkillAt, interact**
			* The above commands will be deprecated and eventually removed from the core. Please update your scripts
			** interact() will remain for waypoint and grab item to cursor usage and player trade only
		Usage: Try and send down then up commands as much as possible to correctly simulate actual game play. Use "hold" as appropriate.
		Note: Sending Down but not Up will result in a Mouse Down lock that will hinder regular gameplay until the game detects mouse up.
			Be sure and send both down AND up, even if it doesnt seem applicable (it is)

	.	Tons of updates to make d2jsp compatable with 1.10 beta.

	.	Added me.pingtimer; // Returns a realtime ms counter of how long it's been since the last packet arrived.
		Example: .exec while(1) { delay(10); me.overhead(me.pingtimer); }

	.	Updated item.pid and item.sid, now only returns 3 on rares, crafted, tempered, since only up to 3 each can spawn.

	.	Removed the follow properties for items, use getBaseStat()
		item.flpfile, item.invfile, item.sinvfile, item.uinvfile
		**NOTE: item.xsize, item.ysize, item.itemtype WILL BE REMOVED SOON! UPDATE NOW!

	.	unit.cancel(1); no longer works to close a shop (trade) window, use unit.cancel(0);

	.	Changed unit.area; // now returns the area the unit actually resides in.
		For shrines/portals, this will not return the linked area anymore, see subarea for that.
		For chest modes, see status for that.

	.	Added unit.subarea; // returns the linking area (portals/stairs) or the ShrineNo for shrines

	.	Fixed unattach d2jsp crash bug (hopefully once and for all)

	.	Added inputlineHandler() // new event handler to capture typed messages that start with a .
		Example: .exec function inputlineHandler(x) { me.overhead(x); }; while(1) delay(100);

	.	Added getBaseStat(TYPE, CLASSID, Index); // returns a property from a base stat table
		0 = Items (base_items.d2l), 1 = Monsters (base_monstats.d2l), 2 = Skill Desc (base_skilldesc.d2l), 3 = Skill (base_skill.d2l),
		Please refer to the libs/ directory to find the appropriate file.

	.	Removed item.getBaseStat(), use getBaseStat() above

	.	Removed getSkillInfo(), use getBaseStat() above

	.	Added int_array = getMouseCoords([optional 1]); // Returns Screen Relative X Y coordinates of mouse cursor.
		If paramater is 1, will return Game Relative X Y coordinates of mouse cursor.
		The returned value is a 2 member array, containing the X and Y coordinate

	.	Fixed missile.x and missile.y; This will now return the correct x y of the missile.

	.	Made d2jsp backwards compatable with 1.09d
	.	getBaseStat(2) is not available under 1.09d

	.	Please note: 1.10 beta base stat d2l's are very different than the 1.09d versions. You can find them in libs/1.10/

	.	Added unit.status for chest modes. This replaces the old chest.area to check a chest "locked/trapped" status.

	.	me.version now returns a string with the minor version (for example, 0.3318, which would be 0.33 major, 18 minor)

	.	Fixed exit bug, where if you exited a game manually under certain scripts still running, joining next game would
		result in a crash.	Thanks TDW and mousepad

	.	Fixed DDE Server core to be DDE compliant. Thanks Sherpya!
		DDE Server now accepts only Execute or Poke commands. Examples:
		From d2jsp: .exec x="d2jsp-00000"+getMyPID().toString(16); sendDDE(2,x,"exec","","print('a b c d e f g')");
		From mIRC:  /dde d2jsp-0000022c exec "" print('a b c d e f g')





version 0.32 - (6/24/2003)
	.	Thanks again to mousepad for function calls and information for this release :)
	.	Thanks to Sherpya and Raeky for helping get me source code examples to get the DDE stuff working!
	.	Thanks to TheDesertWind for testing and debugging and help!

	.	Added sendDDE(Mode, DDEServer, Topic, Command, Data); // sends a DDE message to a DDE Server
		Example: sendDDE(1,"mIRC","command","","/msg njaguar hi there");
		Modes: 0=REQUEST, 1=POKE, 2=EXECUTE

	.	Added a DDE Server into d2jsp! Only pass "REQUEST"s to the core. Each server will be: d2jsp-HEXPID
		Example: d2jsp-4F80BA91 (process ID of d2jsp)
		Example syntax (from mIRC) to send to d2jsp: /dde -r d2jsp-4F80BA91 "" print("I love DDE")

	.	Added getMyPID(); // This is required as a parameter to talk with the GUI so it knows where the commands are coming from

	.	Added item.getItemCost(mode); // gets the cost of the item;
		Pass 0 for buy value (you buying from them), 1 for sell value, and 2 for repair cost

	.	Added getUnit(101); // Pass this to get the current NPC you are in trade with (must be in trade, or returns undefined)

	.	getUnit(100); now returns an item that cursor is over in inventory/trade/shop/etc

	.	Added acceptTrade([optional 0 or 1]); // This will accept trade of another player, if you are in trade.
		Use me.cancel(0); to cancel a player trade.
		Pass 0 to retrieve your checked status (returns 0 for not checked, 1 for checked (green), 2 for red (not ready)
		Pass 1 to retrieve if the other person's checkmark is checked (green)

	.	Added getWaypoint(waypointNumber); // returns true or false if you have it. 0 to 8 = act 1, 9 to 17 = act 2, etc..

	.	Increased the item.fname temp buffer from 128 to 256 wchar bytes. (Some other languages get crashes from this being too small)

	.	Added stop([optional 1]); // overload.. If you pass 1, it will stop ONLY the current script. No params still stops all running scripts

	.	Changed clickParty(partyunit, mode) to require a PartyPlayer unit object ( get with partyunit=getParty([id]); )

	.	Fixed me.setSkill() if the skill is obtained from an item.

	.	Added 3rd optional parameter to me.setSkill(skill_name, hand, item_id);
		Pass item_unit.gid as third parameter to specify which item to use a skill charge from.

	.	Added param to getRoom([optional 0]), pass 0 to return your CURRENT room.

	.	Added param to getRoom([optional areaID]), pass an Area ID to return that area's first room.
		** NOTE: The area must be in your present act!

	.	Added getDistance(unit1, unit2) function. Pass two unit objects to get the distance between the two.

	.	Fixed getUnit(3); // MISSILES! This now works 100%! You can loop/list all the missiles!

	.	Added room.subnumber; this is the "file no" field in the lvlprest.txt file

	.	Update to getRoom(): If a room has a type of 1, it will return -1 for room.number and room.subnumber

	.	Added Diablo II version verification to make sure d2jsp won't run on an invalid patch version. (d2jsp would cause D2 to crash otherwise)

	.	Fixed blank prefix/suffix string overflow where it'd return the previous prefix/suffix if current was blank (js32 bug)

	.	room.getCollision() with no params will now return a two dimensional array with all the collision values for the room!

	.	Added item.pid; returns the prefix ID for a magical item.
		Returns an array of 4 prefix IDs for rares and crafted, 1st # will be the Rare/Crafted Name Prefix ID, last 3 are the actual magical prefix IDs

	.	Added item.sid; returns the suffix ID for a magical item.
		Returns an array of 4 suffix IDs for rares and crafted, 1st # will be the Rare/Crafted Name Suffix ID, last 3 are the actual magical suffix IDs

	.	Added me.setSkill() and me.getSkill() overload. You can now replace the "string" name of a skill with the ID.
		Ie, me.setSkill(0,0) would set Attack to Right Hand.

	.	Added me.getSkill([2 or 3]); // This will return Right or Left hand Skill ID instead of Skill Name.

	.	Added item.lvlreq; // Returns Level Requirement of item

	.	Added room.getPresetUnits([type],[id]); // This returns an ARRAY of presetunit objects!
		Params: Type will specify what type to return; ID will specify only what id's to return
		presetunit Object Properties: presetunit.id, presetunit.type, presetunit.x, presetunit.y
		**Note: In order to get presetunits for far away rooms, you will likely have to initialize/release the room(s)

	.	Added room.levelx; // Returns X coordinates for a Level (area)

	.	Added room.levely; // Returns Y coordinates for a Level (area)

	.	Added item.pname; // Returns the Personalized Name of an item, or blank if none.

	.	Waypoint usage is fixed, do NOT send a cancel() command after using a waypoint anymore!

	.	Removing room.init() and room.release(); // These are no longer required, the core will init/release a room as required.
		**Note: Please remove these from your scripts, this will be 100% removed in future versions.

	.	Added getSkillInfo([SkillID or SkillName], index);
		Returns Skill Info from memory, refer to getskillinfo.txt for a list of what the index's are
		You can get information about any skill, even a skill you do not have/cannot use

	.	Updated getSkill() to allow you to pass any unit object (NPC or player)

	.	Added index 100 and 101 to getSkillInfo which returns Locale Skill Name, and Locale Skill Description

	.	Added getRating(value, monster_class_id);
		** Notes: For value, Pass 0 for right hand, 1 for left hand, this will return Attack Rating %
		To get Block %, call it like this: getRating( 3, 0 );

	.	Added me.showlifeorb; Set this to 1 to permanently show your life above your life orb
		**Note: With this on, even if you mouseover your Mana Orb, it will not show up.

	.	Added me.showmanaorb; Set this to 1 to permanently show your mana above your mana orb
		**Note: If you mouse over your life orb with this on, it will temp turn it off and show your life.

	.	Added runGC(); // Forces a run of the Garbage Collector (frees javascript stuff no longer in use)

	.	Removed all Unicode->Single conversions on directly returned text, they now return as Unicode

	.	Added extension to ScreenHooks, ability to DRAW LINES!
		Added two new properties: screenhook.x2 and screenhook.y2; // if these are not -1, a line will be drawn.
		**Notes: The .color for lines differs from text, so 0 is actually black for lines.
			If you want text and line, simple leave text in screenhook.text, and fill in screenhook.x2 and screenhook.y2
			If you only want a line, set .x2 and .y2 to a value, and then set screenhook.text = "";
			If you want only text, set screenhook.x2 and screenhook.y2 = -1;
			If you want to delete a line, set .x2 and .y2 to -1, then set .text to ""

	.	Converted ScreenHooks to Unicode, faster display times, international, etc.

	.	Converted all Event Handlers to return Unicode text messages (where applicable).

	.	Added me.showexp; // Set this to 1 to permanently show your experience above your exp bar

	.	Fixed a crash problem with room usage/looping. Multi-thread collision issue (now CritSects)

	.	Fixed a crash bug with building other levels (rooms), also multi-thread issue

	.	Fixed many other minor issues/multi-threading bugs



version 0.31 - (3/6/2003 10:23PM)
	.	Minor code cleanups and tweaks

	.	Made ExitGame() thread safe (should cause the random crashes on game exit to stop)

	.	Fixed item.interact(); // you can no longer pick up an item from the ground if you have an item on your cursor

	.	Converted the main threading loop blocking to Critical Sections.

	.	stop() and quit() no longer register as errors in the script.

	.	Rewrote the core SpiderMonkey handler to run each script in a seperate Runtime
		This should stop the access violations related to destroying a context, and other misc errors

	.	Fixed to command line .exec where it would lose the entered data sometimes (null ptrs, etc)

	.	Added file.flush(); // this will flush all current data written in buffer to disk.
		This just calls the C fflush(FILE *) command.

	.	You may no longer pass body location values to clickItem() in the range of 11 to 100, or 111+
		These would cause crashes, because they are invalid body locations.

	.	More misc debugging and code fixes/cleanup

	.	.stop will now only print a message if there are scripts running and the stop flag is false

	.	Added me.quitonhostile; .. If you set this to 1, it will auto quit if someone hostiles you and you aren't in town.

	.	Fixed chicken so that it will no longer occur if you are in town.

	.	Added a message display if you try to load a script that doesnt exist



version 0.30 - (2/26/2003 9:29PM)
	.	Fixed numerous multiple thread issue crashes (cancel, useMenu, interact, shop) (thanks mousepad and TDW)

	.	Fixed a divide by zero error if you passed null as first param of getUnit();

	.	Fixed useMenu(), you can no longer use it if you're not first interacted.

	.	Fixed shop() and repair(), you can no longer call these if the unit is not an npc, and you're not in the shop

	.	Fixed getUnit() lookup by classid, this should now work correctly

	.	Fixed a bug in getUnit() and getNext() that wouldn't allow you to spot the first Tile object in the game.
		The reason for this was because Tiles can be *zero base* for the id, whereas no other (known) types can.

	.	Fixed crash bug in sell if D2 is minimized (thanks mousepad!)

	.	Added multi thread blocking around clickItem function and the cancel(0); (crash prevention)

	.	Fixed getPlayerFlag(); // pass: getPlayerFlag(player1_gid, player2_gid, mode);

	.	item.runeword now only returns a string if the item actually has a runeword

	.	Redid the screenhook linked list so that the draw routine deletes nodes as needed (thus preventing multi-threading)

	.	All selling, buying, and shift buying issues are now resolved when minimized (thanks mousepad!)

	.	added getUnit(100); // This will return the current unit that your mouse is hovered over

	.	Fixed clickItem(); so that it works when you first enter the game

	.	Fixed submitItem(); // Will now work on the orifice as well (thanks mousepad)

	.	Added copyUnit(unit); function. This will copy the unit passed, and return it so you can assign it to another var;
		copyOfMe=copyUnit(me);

	.	Fixed .stop (and stop()), should be more immediate; will abort as fast as it can

	.	Fixed unload method, unloads as fast as it can, rather than on a static 1 second delay (woot!)

	.	Added event handlers! If you wish to use them, put any of the following in your code:
		function gamemsgHandler() { ... };
		function hostilemsgHandler() { ... };
		function partymsgHandler() { ... };
		function keypressHandler() { ... };

	.	Fixed the general script abort method, now uses an interrupt in the JS core to abort quicker. Also has a notification.

	.	Removed msg object, use the event handlers!

	.	Fixed broken unit.getParent() from 0.30.12

	.	Converted event handlers to use CriticalSections

	.	Fixed a memory leak in the new event handler that would occur when a script terminated and had pending events

	.	Made some linked list cleanups and code tweaks




version 0.29 - (2/18/2003 4:23PM)
	.	d2hackit is OUT THE DOOR! No more d2hackit d2jsp, booya. It's now self contained.
		No, I won't make it possible to load as a module of d2hackit.

	.	d2jsp no longer outputs a single packet by hand. Every single thing in the core is a function call. NO MORE PACKETS!

	.	Huge thanks go out to mousepad for this release, thanks for all the assistance!

	.	me.move(); will now automatically call the D2 Function rather than fake a packet.
		Automatically sends the walk/run packet depending on what is toggled. (see me.runwalk)

	.	unit.interact(); now uses a function call instead of packet forging. Booya. (Only for movement, and npc/objects)

	.	Removed StringTableLookup() calls on fname, prefix and suffix. Was crashing for non english D2s :(

	.	Added me.revive(); Will revive you after you die (PRESS ESC TO CONTINUE menu);
		Obviously doesn't apply to hardcore. Make sure chicken is turned off, otherwise it'll just quit the game instead. :)

	.	Added item.shop(npc,mode); // mode: 0=repair, 1=sell, 2=buy; Pass the OBJECT of the npc, ie: npc=getNPC('Malah'); item.sell(npc);
		Make sure you are interact()'d first, of course. If you aren't, it'll crash d2 :P
		This also returns the error/success code for buying/selling/repairing (if applicable)

	.	Removed BUY usage of item.interact(); to BUY an item, use item.shop(npc,2);

	.	Removed unit.busy; property, dont think it's at all useful.

	.	Removed me.showtxmsg and me.showrxmsg; no more packets. Get over it.

	.	npc.repair(); now is a function call to repairAll! Woot. Now returns what the function returns (like item.shop())

	.	Added msg.gamemsg; // will return the last msg from the game (someone talking, an error msg, whatever)
		This can be monitored with watch();

	.	Added msg.partymsg; // will return last party msg from the game (party/loot and unparty/unloot)
		This can be monitored with watch();

	.	Added msg.hostilemsg; // will return last hostile msg from the game (hostile/unhostile)
		This can be monitored with watch();

	.	unit.useSkill(); is now a function call!
	.	unit.useSkillAt(); is now a function call!

	.	Removed raw(); command.

	.	Added npc.useMenu(id); // uses a menu option.. see npcmenuid.txt (thanks mousepad!)
		*NOTE* This replaces trade()/gamble()/revive() functions!!! Start using this!

	.	Removed npc.trade();
	.	Removed npc.gamble();
	.	Removed npc.revive(); (You can still use me.revive(); however)

	.	Added getUIFlag(id); // see uiflag.txt // This will return if you're in npc interact or not.. etc! (thanks mousepad!)
		if(getUIFlag(8)) print("yes, that's right, I am interacted with an NPC.");
		if(getUIFlag(0x0c)) print("yes, that's right, I am in trade with an npc.");

	.	Added item.runeword; // returns the runeword name of an item (if one exists) (thanks mousepad!)
		Don't rely exclusively on this, make sure to check the flag on this to make sure it's a runeword!

	.	say(); now acts as though you actually typed the message! (thanks mousepad!)
		say("!this is over my head");
		say("/w *mybuddy sup d00d");

	.	Patched into text entry field, instead of d2hackit's packet watch method. This is much more reliable/faster.
		d2jsp now uses it's own keycommands.
		To execute a script, use .exec <text here>        You can now use " double quotes!
		To stop a script, use .stop
		To start a script, use .start

	.	Added me.overhead(text); // this replaces overhead() .. this is a function call, rather than a packet
		This one will NOT go over bnet. This is clientside only. If you want to go over bnet, use the say() command.

	.	Removed unit.getFirst(); // pretty silly, use getUnit(type); to reset it...

	.	Revamped all unit functions! No more 128 unit limit! Will now return every single unit type on your screen!

	.	Removed getPlayer(), getNPC(), getItem(), getMissile(), getTile(), getObject();

	.	Added unit = getUnit(type,[params]); // this replaces all the above.. the only difference in calling is you ALWAYS pass the type ID.
		*note*: getNext() still works the same.
		Types: 0=Player, 1=NPC, 2=Objects, 4=Items, 5=Tiles, 8=Missiles

	.	Removed a bunch more d2hackit dependencies. Very little of d2jsp is reliant on d2hackit now.

	.	item.prefix and item.suffix are now correctly returning their translated values! WOOT!

	.	item.fname; // returns exactly the name D2 builds.

	.	submitItem(); // do one of the following: might need delays. Replace items with what item you wanna submit :P
		orifice.interact(); staff.interact(); submitItem();
		larzuk.interact(); larzuk.useMenu(0x58DC); item.interact(); submitItem(); // adds sockets to item
		etc..

	.	Replaced me.useStatPoint() with useStatPoint(); // also a function call now
	.	Replaced me.useSkillPoint() with useSkillPoint(); // also a function call now

	.	msg.gamemsg; now returns the LAST message up in the top left part of the screen (bnet, game, whatever)

	.	Added room.init(); // This will initialize a room that is offscreen from you. Be sure to release() it when you're done!

	.	Added room.release(); // used to release a room from memory when you're done using the collision/info of it.

	.	item.getParent(); // now returns correctly returns the parent, whether its a player, npc, monster, or another item! (socketed!)

	.	gold(amount,loc); is now a function call, PARAMS CHANGED!
		Location is now: 1 = inv->ground, 3 = inv->stash, 4 = stash->inv  ... I think 2 = to trade, not sure..

	.	item.move(body_location); // now a function call

	.	item.interact(); // now a function call to pick up item off ground, pass a 1 to pick up to cursor.

	.	me.setSkill(); // now a function call;
		THIS NO LONGER BLOCKS! THIS WILL RETURN IMMEDIATELY, SO MAKE SURE YOU DELAY UNTIL IT'S REALLY CHANGED!

	.	Added clickItem(button,[other..]); // button: 0=left, 1=right, 2=shift left click(put to belt) params are as follows:
		either pass: x, y, location (0,0 is top left, always, 1,1 is one left, one down in the grid, etc
			location=: 0=inventory, 2=player trade, 3=cube, 4=stash
		Or, if you'd like to simply click an item already in your inv/stash/cube, etc: clickItem(button,item);
		Also, you can call your body location: clickItem(button, body_location);

	.	Removed unit.cancel() with no params. You must now pass 0 or 1. (See previous history)

	.	Removed unit.use(); // use clickItem(1, item); now

	.	item.interact([optional 1]); now only works on items on the ground. Pass 1 to pick the item up to cursor.

	.	Removed item.move(x,y,loc);   Use clickItem();

	.	me.showcast and me.showmove no longer function. This is because I'm calling d2 functions, rather than packeting.
		I will disable the graphics routines in a later version, among other ways to make d2 take less resources. :)

	.	clickItem(L_R, x, y, 5); // This will left/right click on your belt.
		Alternately, pass 3 as the button (1st paramater) to "shift" right click the potion which gives to your mercenary
		You can also still pass the item, ie, clickItem(L_R, potion_item);

	.	Removed drinkBeltPotion(); // use clickItem() instead.

	.	Removed me.weaponswitch; // property, use weaponSwitch();

	.	Added weaponSwitch([optional 1]); // call with no param to switch your weapon
		call with a 1 to return the current slot

	.	me.chickenhp and me.chickenmp work only on a per session level now. If you make a new game, you must set them again for it to work.
		Once you quit, they are turned off, and rejoining a new game won't chicken unless you set them again.
		So, just set this every game in your script (as you all probably already are.) This really only applies to people manually typing it. ;)

	.	Centered version display

	.	Fixed npc.repair(); .. This is equivalent to Repair All

	.	Disabled item.shop(npc,0); .. this is repair specific Item, but not working correctly.. use repair() for now

	.	clickItem(left, body_location+100); // this now grabs an item from your mercenary.
		Alternately, just pass the item itself, if it's on the merc, it'll grab it.

	.	Added item.cancel(); // if item=the item on your cursor, then this will drop that item to the ground.

	.	file.writeLine(); is fixed, it no longer outputs CR CR LF, just CR LF like it should.

	.	Added transmute(); // this replaces item.interact(2); ..

	.	Added shift buy, item.shop(npc,3); // pass three to simulate a shift left click (ie, fill book, stack arrows, etc)

	.	Misc bug fixes from release 0.29.13 to 0.29.14

	.	Added clickParty(player, mode); // calls the party functions based on mode, for the player unit passed
		0 = Loot toggle, 1 = Hostile toggle, 2 = Party with Player, 3 = Leave Party

	.	item.shop(npc,mode); // Now validates the item you're passing to make sure it's really on your or npc depending on the mode



version 0.28 - (1/19/2003 9:07PM)
	.	Big thanks go out to bluemind and mousepad; their efforts and information are what made this version so grand!

	.	Rewrote getRoom() methods. Now they are dynamic and on the fly memory loops.

	.	Added room.correcttomb; Returns the id (number) of the correct tomb.

	.	Added room.level; Returns the level number (from levels.txt)

	.	More core cleanups and obsolete code removal.

	.	Fixed item.fname, item.prefix, item.suffix to return the local translation of the affix/item name (set/uni).

	.	Added room.getStat(int); see roomstats.txt for more info

	.	Added room.getCollision(x, y); // returns the collision table value for XY coord. of the room (thanks mattlant)

	.	Fixed rnd(); Now returns random numbers again. (lol)

	.	Added getParty(int); // pass a player.gid, creates the party object.
		Available properties: .name, .gid, .life, .level (char level), .area, .x, .y, .partyid (65535 for no party)
		Please note that most of this is NOT populated if the person is NOT in your party.

	.	Added party.getNext(); // method to get next person on the party list (P)

	.	Added me.runwalk; Returns 0 or 1 if you are walking or running.
		You can toggle this by assigning it any value; eg: me.runwalk=1; will toggle the run/walk.

	.	Added me.playertype; returns 0 or 1, for softcore/hardcore

	.	Added me.gametype;	returns 0 or 1, for classic, xpac

	.	Added me.weaponswitch;	returns 0 or 1 for I or II; this will phase out me.weaponSwitch(); start using this!
		You can toggle this by assigning it any value; eg: me.weaponswitch=1; will toggle the weaponswitch.
		This weapon switch uses a function call to D2, no packets!

	.	Added function takeScreenshot(); // does as it says.. don't overuse this :P

	.	Added function drinkBeltPotion(slot, [give to merc?]); // slot is 0 to 3, for your 1,2,3,4 minus 1.
		Alternately, pass ,1 as the second parameter to feed the potion to a merc without needing to pick it to cursor first.
		Alternately, pass ,2 as the third parameter to test if there is something on that slot (returns 0 for false, 1 for true)

	.	Fixed unit.cancel(type); now uses a D2 cancel call, instead of a "space press". This should solve all the issues regarding cancel!
		This will replace unit.cancel() with no parameter; eventually this will not work! be sure to pass 0 or 1!!
		Pass 0 or 1, 0 to cancel/close cube/stash/waypoint/player trade; 1 to close npc related things (menu, trade/gamble)



version 0.27 - (Jan 13 2003, 8:35 PM)
	.	Added me.screensize; returns 0 for 640x480, 2 for 800x600

	.	Changed the "cancel" method to for sure call the keypress (space) on the correct D2 window now.

	.	Added screenhook.font=int; //(0 to 13) You can now get a lowercase capable font! WOOT!
		Please note, font isnt like normal font size, it's a font face, use 0 to 13 (0-8 are legible, beyond that they arent)

	.	Fixed a divide by zero error in rnd() (thanks TheDesertWind)

	.	Fixed core crash related to retrieving unidentified rare affix or name (thanks to all who reported this)

	.	Added null checks for misc portions of the code (more crash prevention methods)

	.	Allowed *.busy to work for all unit types. Was previously not returning unit type == player
		I cannot remember why I had it setup like this. Perhaps a typo that was supposed to ONLY be for unit player

	.	Fixed a bug where closing a file handle doesn't release it's handle, and thus cannot be re-used.
		(thanks TheDesertWind)

	.	Fixed a crash bug where if you tried viewing unit.itemoncursor on an npc, item, etc, would crash
		(thanks TheDesertWind)

	.	Lots of code cleanup (readability, modularizing)

	.	Fixed crash bug: when you built a level with getRoom() and then pressed tab; should also be more compatible with maphack now

	.	Removed the static linking of msvcp60.dll again, lots of people were having troubles



version 0.26 - (Jan 08 2003, 3:41 PM)
	.	Added me.lasterror, returns the last error message
		Spawns over multiple game sessions, so you can read error in next game (use in conjunction with me.quitonerror)
		Once you read it once, it automatically resets it to "", so you can only read this in once

	.	Added back in getScreenHook() !!!!! Got it working, woohoo!!!!!!

	.	Added version display on screen (permanent)

	.	Added www.d2jsp.org url to welcome display (loadup)

	.	Added me.getQuest(act,quest);
		I do not know what quests are what precisely. This will require experimenting.
		1,1 = den; 4,10 is Cow Level, that's all I've verified.


version 0.25 - (Dec 30 2002, 8:20 PM)
	.	Added me.ping, returns your current ping value

	.	Added me.skip, returns your current frame skip value

	.	Added me.diff, returns your current difficulty (0 norm, 1 nm, 2 hell)

	.	Changed game loaded state checking, hopefully it's more accurate than before

	.	Added unit.owner; returns the id of the owner (eg, single player, 1 for you, -1 for no owner)
		This is meant as an alternative for getParent(); which will be phased out eventually
		When used on a missile, returns the id of the owner of the missile

	.	Added unit.ownertype; returns the owner type of a missile (0 player, 1 npc/monster)

	.	Added me.version; returns the version of the core (0.25 and beyond)

	.	Added item.getBaseStat(); (see basestats.txt for lookups)
		Please note, this replaces item.xsize and item.ysize and item.itemtype;
		They are 35, 36, 50 respectively for the lookup function.
		Please update your scripts to use getBaseStat(), the other 3 will be removed in future versions

	.	Compiled with msvcp60.dll statically linked again (slightly larger exe size)
		Should help alleviate some of the support problems of d2jsp not loading

	.	Removed messenger (use msg.)


version 0.24 - (Nov 8 2002, 03:34 PM)
	.	Added me.showcast
		This defaults to on (1), if you set it to 0, it will not show you using/casting spells.

	.	Added me.showmove
		This defaults to on (1), if you set it to 0, it will not show you moving all the time.
		** this will cause your me.x and me.y to NOT be updated, so if your scipt makes use of these, the script will cease functioning

	.	Added [unit].gid; Returns the global ID of the unit, used for packeting :P

	.	Fixed item.fname; will now return just the item basename if it's not the correct item type

	.	Fixed item.prefix/suffix; will now return "" if there is no prefix/suffix or the item is not of the appropriate type

	.	More core optimizations, should be smaller and faster now.

	.	Removed sniffrx() and snifftx()


version 0.23 -
	.	Removed 0x5f packet block, should result in fewer blackwalls. (blocking this packet is obsolete)

	.	Fixed a bug where .d2jsp stop and then start would rerun the last run script (from "load()")

	.	Added me.quitscriptend; Defaults to 0. Set this to 1 if you'd like the game to exit when any script finishes execution.

	.	Added msg. object, which is similiar to messenger. The difference is that this object can make use of the watch() event.
		messenger will be phased out in coming versions; please start using msg.
		To assign a value, use msg.send("property","value"); Make sure they are both Strings.

	.	Added me.showrxmsg; Defaults to 0, if set to 1, will insert last rx packet to msg.rxpacket

	.	Added me.showtxmsg; Defaults to 0, if set to 1, will insert last tx packet to msg.txpacket

	.	* sniffer(); will be phased out, since you can use watch() to get your own packet events. Update your scripts accordingly

	.	Added item.fname; Will return the full name of the item, see below
		Magical: "prefix basename suffix"
		Rare: "prefix suffix"
		Set: Item Set Name
		Unique: Item Unique Name
		Crafted: "prefix suffix"
		* (null) will be returned for affixes in this if the particular affix isn't in use.
		* You will get odd results if you attempt to use this on an item type not listed above (A rune, for example)
		* Please also note that some of the affixes displayed in game are labeled differently, sort of like the variations in some skill names.

	.	Added item.prefix; Returns prefix name of item (magical or rare or crafted only)

	.	Added item.suffix; Returns suffix name of item (magical or rare or crafted only)


version 0.22 -
	.	Added more item properties:
		item.flpfile, item.invfile, item.sinvfile, item.uinvfile;
		Returns the flp filename, inv filename, set inv filename, unique inv filename, respectively

	.	Unloading d2jsp in the middle of script execution should no longer crash D2. You will get a 1 second "freeze" while it waits
		for the scripts to terminate.

	.	Made space keypress for cancel() more international (still not 100% fixed), and added back in the packet sends so it'll work minimized.


version 0.21 -
	.	Fixed chickenhp and mp (again). Forgot the bitshift the values >>8

	.	Added overloaded me.weaponSwitch([1]); .. pass a 1 to have it return the current slot, 0=I, 1=II

	.	Added me.quitonerror; Defaults to 0, set this to 1 to have a script automatically quit if an error occurs.
		Not recommended to set this until your script is mature, this is just to prevent the odd misc error from stopping infinite runs.


version 0.20 -
	.	** IMPORTANT: Revamped directory structure, new naming scheme
	.	include() now places you in scripts/libs/ instead of scripts/
	.	fileOpen() now places you in scripts/ instead of output/

	.	Now fails to open if you include any illegal characters in a filename.

	.	Added item.itemclass; returns 0,1,2; 0=Normal, 1=Exceptional, 2=Elite

	.	Fixed D2 hwnd lookup that was causing PostMessage() for cancel to fail in games labeled other than "Diablo II" (.cancel() sends a space to D2)

	.	Added gold(amount, loc); function
		amount = amount to "move or drop". loc = location, 0 drop to ground, 1 move to inventory, 2 move to stash

	.	Added me.useStatPoint(stat); Uses a stat point on the value specified by "stat". (see stats.txt)
	.	Added me.useSkillPoint(skill); Uses a skill point on the number value specified by "skill". Right now, it only accepts a numeric value, see skills.txt
		** Please note, passing an invalid value might get you a connection interrupted, or even crash diablo II. I'll make it smarter later.

	.	Fixed a bug in loadScript() that was attempting to free the buffer even if it wasnt set.


beta 19 -
	.	Added item.ilvl; returns the ilvl of the item.

	.	Fixed getSkill(), sometimes would return just the base when it shouldn't have.

	.	Added item.getFlag(flag);
		Please see itemflags.txt for a list of all the flags (known)

	.	Added getPlayerFlag(player1, player2, flag);
		interchange player1 and player2 to find if they are hostile to you and vice versa.
		flag: 8 = hostility check, 1 = loot check


beta 18a -
	.	Temporarily removed screen hooks. This is causing crash problems for some people. Need to revamp it.

	.	Added item.xsize, and item.ysize; returns the size they take up in inventory.

	.	Fixed getMissile(), should return a list of missiles now. (go go mephbot!)


beta 18 -
	.	Added getScreenHook();
		screen = getScreenHook();
		screen.x, y, color and text. x,y,color are integer values (color is 0 to 11). Text is the text you want on the screen.
		x y are the screen coordinates. If you want to remove a hook, do screenhook1.text=""; This will remove it.
		Refer to sample.d2j for a working sample! BOOYA!!!!!

	.	Fixed getStat() wont let you get a stat < 0 or > 323 (this would crash d2)

	.	Fixed getState() wont let you get a stat < 0 or > 159 (this would crash d2)

	.	getItem() now accepts the Item Base Name instead of code or classid; possibly slightly buggy for a few items.
		hg = getItem("Heavy Gloves");

	.	Added me.realm; returns a string with the realm url (useast.battle.net for example)


beta 17a -
	.	Fixed .getNext(); Should never crash from continuing to getNext() even though you're already at a NULL!

	.	Added object.area; which returns the following:
		For a shrine, it returns the shrine type, for a portal, it will return the remote area ID it will link to.

	.	Added object.getParent();
		returns a string of the name of the person that created it (eg, portals)

	.	Fixed a problem with setSkill() that would render skills with ID's greater than 255 to not work. (eg, Assassin Skills)

	.	Misc code cleanup


beta 17 -
	.	Fixed cube interactions. See sample.d2j test23 and 24 for details
		cube.interact(1); will open the cube
		cube.interact(2); will transmute the cube

	.	Added command line processing: example:
		.d2jsp exec load('script.d2j');
		.d2jsp exec print('scary sexy.');
		.d2jsp exec for(i=0;i<10;i++) say('pwned');
		** please note, you cant use a double quote ("), use single quotes. This is a d2hackit problem, will be fixed when we're not using it anymore :P

	.	Added me.account; returns your account name (bnet only, obviously, returns null otherwise);

	.	Added a global messaging system. messenger object.
		messenger.varname = "message";
		example: messenger.test = "testing testing, 1 2 3"; print(messenger.test);
		refer to sample.d2j and sample_messenger.d2j for a working example of how you can make scripts talk back and forth (and wait for responses). This is crucial for a script like pickit.d2j for example.
		** Please note that these variables persist from GAME TO GAME. Be sure to reset them each game, if a default value is desired at each game start!
		** Note: Only pass a "string" value. It will reject numbers. "123" should work, if not pass something like String("123") or something. JS can easily convert strings to numbers and vice versa.


beta 16 -
	.	Fixed a problem with gambling, now pass item.interact(2); if you are buying an item from gamble mode.
	.	Added in item.name, returns the base name of the item
	.	Fixed Cube Transmute interact(); (was missing the classid of the cube)
	.	Added unit.getParent(); for NPCs. Will return the player unit for the parent of an NPC (merc, minions, etc)
	.	.cancel() now works by sending a SPACE event to the client, rather than faking packets. Does not apply to item.cancel() (drops/sells item)
	.	item.move(merc); now works, supports merc object to drop an item to merc (to equip if item, or drink if potion)


beta 15 -
	.	Revamped itemloc to return based on mode:
		if mode=0 then it will return the location, 0=inventory, 3=cube, 4=stash (tab # for shop), others for trade window, overload into getItem() with +100 this value
		if mode=1 then it will return the body location, see bodylocations.txt, overload getItem() with +200 for this value

	.	Fixed a bug where passing a item code wasnt returning it (wasn't parsing for item code)

	.	Fixed object.x and object.y for objects. These should now return valid X Y coordinates

	.	Removed all item.methods except these new ones noted below:

	.	Added item.interact();
		item.interact([optional 1]);
		if item is on ground, will pick up to inventory, unless 1 is set, where it'll pick up to cursor
		if item is in your posession (or merc), it will pick it up to cursor, unless 1 is used, then it'll use it from that location (or use transmute if cube)
		if item is on an npc for sale, it will purchase the item, if 1 is specified, will simulate a shift right click purchase

	.	Added item.cancel([optional unit]);
		will drop the item on the cursor, or if unit is specified sell that that NPC. (Sell is not yet implemented)

	.	Added item.use(unit);
		This is for id scrolls, first item.interact(1) a scroll or book, and then use item.use(target_unit_object); to ID the item
		Please note this is probably temporary, will probably overload interact() with this, but this will work for the time being.

	.	Added item.move(); ** SEE BELOW, IMPORTANT!
		item.move(x,y,loc) or item.move(loc); or item.move(merc); (merc overload is not implemented yet)
		For the first, it is your location as 0 = inv, 3 = cube, 4 = stash, x y is 0,0 offset of top left.
		item.move(loc); will move an item to a body location (equip).
		** IMPORTANT, MOVING AN ITEM OVER TOP OF ANOTHER ITEM WILL CORRUPT THE CURRENT GAME! BE SURE TO CHECK FOR AN ITEM ON THE SPOT YOU ARE MOVING TO
			AND PICK IT UP BEFORE YOU PUT ANOTHER IN IT'S PLACE! I am working to resolve this somehow without rewriting how d2 handles this internally.


beta 14 -
	.	Added unit.gamble(); method for NPCs.
	.	Added include(scriptinclude);
		Please name all includes as .d2l (that's an L). Do not have duplicate function names. an include file will NOT have a main();
		refer to sample.d2h and d2l for more working examples!


beta 13 -
	.	Fixed a major flaw in the getNext() lookup that could cause it to overflow into the next data type, and possibly cause a crash.
	.	Added getMissile() and getTile();  getTile() is for Stairs and Cave objects, possibly a few others
	.	Fixed numerous .x and .y problems reporting 0 for misc units. Should now report correctly for everything.
		Now also reports the x y offset of where the item is inside your inventory/cube/stash/store, as well as XY if on the ground.


beta 12a -
	.	Fixed a bug with chickenhp and chickenmp, both should work now.
	.	Fixed	bug with file.eof that would result in successive file.readLine() not working
	.	Fixed bug where extra CR was showing up on diablo screen when using file.readLine();


beta 12 -
	.	Removed unit.state, replaced with unit.mode

	.	Removed getCorpse(); use: mycorpse = getPlayer(me.name,17);

	.	unit.busy;
		Will report true or false whether the unit is busy or not.

	.	unit.itemloc;
		For items only, will report the location of the item if the mode = 0.
		For npcs, this is the TAB number they have the item for sale on, for PCs, this is 0 = inventory
			1 & 2 are trade window items, though more exploration needed, seems to not discard some items correctly?
			3= cube, 4=stash (more to come)
			To loop itemloc in the getItem and getNext functions, pass the itemloc + 100, ie, stash = 104

	.	Added unit.getSkill(param1, param2);
		param1 is either your hand (0 = right, 1 = left), OR, a String of the skill, eg, "Frozen Orb"
		if param1 is your hand, it will return a string of the currently selected skill
		if param1 is a string, then param2 is optionally a 1; Will return the current level of the passed Skill, including all mod bonuses.
		if param2 = 1, then getSkill will return only the base skill level.

	.	Tightened unit.drop();, shouldnt crash dropping from cube/stash/equipped, it just wont drop those items at current time.

	.	Rewrote all getUNIT() methods to fire a single function, that is also fired by getNext() to allow overloading (see below)

	.	unit.getNext(param1, param2); unit = getUNIT(param1, param2); UNIT = Player, NPC, Object, Item
		Both params are optional, but 1 must be null if you are using just param2.
		param1 = a String, name of the object, or item code for items, or, it can be the classid of the unit.
		param2 = the mode of the unit. For items, you can pass the item.itemloc, but add +100 to it first, and then pass it.

	.	Lots of code tightening, brought the d2h size down from 124k to 112k

	.	Fixed unit.x and unit.y, should report correct locations of all units except items in inventory/stash/store, etc.

	.	Misc fixes, file restructuring.



pre beta 12 -
	.	Lots of everything, code rewrites, basic core and parsing for every object (except missiles)